<?php
namespace Common\Model;
use Think\Model;
class ProductModel extends Model{
	protected $tableName='product';
	protected $patchValidate=true;
	protected $connection="DB_CONFIG2";
	protected $_validate=array(
			array('title','require','标题不能为空'),
			array('content','require','简介不能为空'),
			array('style','require','规格不能为空'),
			array('price','/^(0|[1-9]\d*)\.\d{2}$/','价格格式错误，应该是5.55'),
			array('userprice','/^(0|[1-9]\d*)\.\d{2}$/','会员价格格式错误，应该是5.55'),
			array('num','/^0|[1-9]\d*$/','库存必须是整型'),
	);
}